<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增帮助与反馈')"/>
</head>

<body class="gray-bg">
<div class="row">
    <div class="col-sm-12">
        <div class="wrapper wrapper-content animated fadeInUp">
            <div class="ibox-content m-b-sm border-bottom">
                <div class="text-center p-lg ">
                    <h2>如果没有找到您需要的问题</h2>
                    <span>您可以点击</span>
                    <button title="Create new cluster" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal5"><i class="fa fa-plus"></i> <span
                            class="bold">进行提问</span>
                    </button>
                   </div>
            </div>
            <div th:each="wxHelp,stat : ${wxHelps}">
                <div class="faq-item">
                    <div class="row">
                        <div class="col-md-7">
                            <a data-toggle="collapse" th:href="${'faq.html#faq'}+${stat.index}" class="faq-question" th:text="${stat.index+1}+${'.'}+${wxHelp.toQuestion}"></a>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <div th:id="${'faq'}+${stat.index}" class="panel-collapse collapse faq-answer">
                                <p th:utext="${wxHelp.sysAnswer}">

                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal inmodal fade" style="z-index:2041;" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">进行提问</h4>
            </div>
            <div class="modal-body">
                <textarea rows="5" style="margin: 0px; height: 224px; width: 863px;" id="toQuestion"></textarea>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary toAsk">保存</button>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<th:block th:include="include :: footer"/>

<script>
    $(document).ready(function () {
        $(".toAsk").click(function () {
            var toQuestion =$('#toQuestion').val()
            if (toQuestion.trim()){
                $.post(ctx+"/wxHelp/wxHelp/addShopQuestion",{toQuestion:toQuestion},function (res) {
                    if (res.code==web_status.FAIL){
                        $.modal.alertError("平台无法进行提问")
                    }else {
                        $('#myModal5').modal("hide");
                        $.modal.alertSuccess("提交成功")
                    }
                })

            } else {
                $.modal.alertError("请输入问题")
            }
        })

    });

</script>


</body>

</html>
